local socket = require "skynet.socket"

local _M = {}

function _M.recv_packet(clientfd)
    local data = socket.readline(clientfd)-- "\n" read = 0
    if not data then
        return
    end
    local pms = {}
    for pm in string.gmatch(data, "%w+") do
        pms[#pms+1] = pm
    end
    return pms
end

function _M.send_packet(clientfd, data)
    socket.write(clientfd, data .. "\n")
end

return _M

